package com.fire.control.system.module.warning.controller.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.fire.control.system.module.common.controller.BaseController;
import com.fire.control.system.module.warning.service.WarningService;
import com.fire.control.system.standard.BusinessInterfaceStandard;
import com.fire.control.system.support.protocol.comman.ResponseProtocol;
import com.fire.control.system.support.protocol.device.DeviceRequestProtocol;
/**
 * 
 * @ClassName:  WarningManagementController
 * @Description:  报警管理控制器
 * @author:  xiechengguang
 * @date:  2017年5月12日 下午5:59:58
 *
 */
@RestController
@RequestMapping(value = "/web/warning")
public class WarningManagementController extends BaseController implements BusinessInterfaceStandard<DeviceRequestProtocol, ResponseProtocol> {
	@Autowired
	private WarningService warningService;
	
	/**
	 * 
	 * @Title: getSolvedWarnings   
	 * @Description: 已处理完成报警设备列表
	 * @param:  requestProtocol      
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value="/getSolvedWarnings", method=RequestMethod.POST)
	@ResponseBody
	public ResponseProtocol getSolvedWarnings(DeviceRequestProtocol requestProtocol) {
		
		return warningService.getSolvedWarnings(requestProtocol, getUser());
	}
	
	/**
	 * 
	 * @Title: deleteSolvedWarning   
	 * @Description: 删除已完成处理报警设备信息  
	 * @param:  requestProtocol      
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value="/deleteSolvedWarning", method=RequestMethod.POST)
	@ResponseBody
	public ResponseProtocol deleteSolvedWarning(DeviceRequestProtocol requestProtocol) {
		
		return warningService.deleteSolvedWarning(requestProtocol);
	}
		
	/**
	 * 
	 * @Title: searchSolvedWarnings   
	 * @Description: 按条件搜索已完成处理报警设备列表  
	 * @param:  requestProtocol      
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value="/searchSolvedWarnings", method=RequestMethod.POST)
	@ResponseBody
	public ResponseProtocol searchSolvedWarnings(DeviceRequestProtocol requestProtocol) {
		
		return warningService.searchSolvedWarnings(requestProtocol, getUser());
	}
	
	/**
	 * 
	 * @Title: getUnsolvedWarnings   
	 * @Description: 待处理报警设备列表
	 * @param:  requestProtocol      
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value="/getUnsolvedWarnings", method=RequestMethod.POST)
	@ResponseBody
	public ResponseProtocol getUnsolvedWarnings(DeviceRequestProtocol requestProtocol) {
		
		return warningService.getUnsolvedWarnings(requestProtocol, getUser());
	}
	
	/**
	 * 
	 * @Title: ignoreWarning   
	 * @Description: 忽略误报 报警设备信息  
	 * @param:  requestProtocol      
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value="/ignoreWarning", method=RequestMethod.POST)
	@ResponseBody
	public ResponseProtocol ignoreWarning(DeviceRequestProtocol requestProtocol) {
		
		return warningService.ignoreWarning(requestProtocol);
	}
	
	/**
	 * 
	 * @Title: searchDeviceMaintences   
	 * @Description: 按条件搜索未处理的报警设备列表  
	 * @param:  requestProtocol      
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value="/searchUnsolvedWarnings", method=RequestMethod.POST)
	@ResponseBody
	public ResponseProtocol searchUnsolvedWarnings(DeviceRequestProtocol requestProtocol) {
		
		return warningService.searchUnsolvedWarnings(requestProtocol, getUser());
	}
	
	/**
	 * 
	 * @Title: getWarningModeList   
	 * @Description: 报警模式设置列表
	 * @param:  requestProtocol      
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value="/getWarningModeList", method=RequestMethod.POST)
	@ResponseBody
	public ResponseProtocol getWarningModeList(DeviceRequestProtocol requestProtocol) {
		
		return warningService.getWarningModeList(requestProtocol);
	}
	
	/**
	 * 
	 * @Title: deleteWarningMode   
	 * @Description: 删除报警模式设置信息  
	 * @param:  requestProtocol      
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value="/deleteWarningMode", method=RequestMethod.POST)
	@ResponseBody
	public ResponseProtocol deleteWarningMode(DeviceRequestProtocol requestProtocol) {
		
		return warningService.deleteWarningMode(requestProtocol);
	}
	
	/**
	 * 
	 * @Title: updateWarningMode   
	 * @Description: 修改报警模式设置信息  
	 * @param:  requestProtocol      
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value="/updateWarningMode", method=RequestMethod.POST)
	@ResponseBody
	public ResponseProtocol updateWarningMode(DeviceRequestProtocol requestProtocol) {
		
		return warningService.updateWarningMode(requestProtocol);
	}
	
	/**
	 * 
	 * @Title: addWarningMode   
	 * @Description: 新增报警模式设置信息  
	 * @param:  requestProtocol      
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value="/addWarningMode", method=RequestMethod.POST)
	@ResponseBody
	public ResponseProtocol addWarningMode(DeviceRequestProtocol requestProtocol) {
		
		return warningService.addWarningMode(requestProtocol);
	}
	
	/**
	 * 
	 * @Title: getMsgPushList   
	 * @Description: 报警推送设置列表
	 * @param:  requestProtocol      
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value="/getMsgPushList", method=RequestMethod.POST)
	@ResponseBody
	public ResponseProtocol getMsgPushList(DeviceRequestProtocol requestProtocol) {
		
		return warningService.getMsgPushList(requestProtocol, getUser());
	}
	
	/**
	 * 
	 * @Title: deleteMsgPushSet   
	 * @Description: 删除报警推送设置信息  
	 * @param:  requestProtocol      
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value="/deleteMsgPushSet", method=RequestMethod.POST)
	@ResponseBody
	public ResponseProtocol deleteMsgPushSet(DeviceRequestProtocol requestProtocol) {
		
		return warningService.deleteMsgPushSet(requestProtocol);
	}
	
	/**
	 * 
	 * @Title: addMsgPushSet   
	 * @Description: 新增报警推送设置信息  
	 * @param:  requestProtocol      
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value="/addMsgPushSet", method=RequestMethod.POST)
	@ResponseBody
	public ResponseProtocol addMsgPushSet(@RequestBody DeviceRequestProtocol requestProtocol) {
		
		return warningService.addMsgPushSet(requestProtocol, getUser());
	}
	
	/**
	 * 
	 * @Title: addDefaultMsgPushSet   
	 * @Description: 添加默认报警推送设置信息  
	 * @param:  requestProtocol      
	 * @return: ResponseProtocol      
	 * @throws
	 */
	/*@RequestMapping(value="/addDefaultMsgPushSet", method=RequestMethod.POST)
	@ResponseBody
	public ResponseProtocol addDefaultMsgPushSet(@RequestBody DeviceRequestProtocol requestProtocol) {
		
		return warningService.addDefaultMsgPushSet(requestProtocol, getUser());
	}*/
	
	/**
	 * 
	 * @Title: updateMsgPushSet   
	 * @Description: 修改报警推送设置信息  
	 * @param:  requestProtocol      
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value="/updateMsgPushSet", method=RequestMethod.POST)
	@ResponseBody
	public ResponseProtocol updateMsgPushSet(@RequestBody DeviceRequestProtocol requestProtocol) {
		
		return warningService.updateMsgPushSet(requestProtocol, getUser());
	}
	
	/**
	 * 
	 * @Title: getMsgPushSetById   
	 * @Description: 获取报警推送设置信息  
	 * @param:  requestProtocol      
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value="/getMsgPushSetById", method=RequestMethod.POST)
	@ResponseBody
	public ResponseProtocol getMsgPushSetById(DeviceRequestProtocol requestProtocol) {
		
		return warningService.getMsgPushSetById(requestProtocol);
	}
	
	/**
	 * 
	 * @Title: applyforMaintence   
	 * @Description: 维保申请（使用单位） 
	 * @param:  requestProtocol      
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value="/applyforMaintence", method=RequestMethod.POST)
	@ResponseBody
	public ResponseProtocol applyforMaintence(@RequestBody DeviceRequestProtocol requestProtocol) {
		
		return warningService.applyforMaintence(requestProtocol, getUser());
	}
	
	/**
	 * 
	 * @Title: manualSendWarnings   
	 * @Description: 手动推送报警信息 
	 * @param:  requestProtocol      
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value="/manualSendWarnings", method=RequestMethod.POST)
	@ResponseBody
	public ResponseProtocol manualSendWarnings(@RequestBody DeviceRequestProtocol requestProtocol) {
		
		return warningService.manualSendWarnings(requestProtocol);
	}
	
}
